/**
 * @filename:OccupyServiceImpl Sep 19, 2024
 * @project Wonder Vue Admin Api  1.1.0
 * Copyright(c) 2022 Wonder Co. Ltd. 
 * All right reserved. 
 */
package com.wonder.app.service.impl;

import com.wonder.app.domain.Occupy;
import com.wonder.app.mapper.OccupyDao;
import com.wonder.app.service.OccupyService;
import com.wonder.app.request.OccupyRequest;
import com.wonder.common.utils.StringUtils;
import com.wonder.common.utils.MessageUtils;
import com.wonder.common.common.AjaxResult;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * @Description:TODO(库存占用服务实现)
 *
 * @version: 1.1.0
 * @author: Wonder
 *
 */
@Service
public class OccupyServiceImpl  extends ServiceImpl<OccupyDao, Occupy> implements OccupyService  {

    /**
     * 验证库存占用信息
     *
     * @param occupy
     * @param type
     * @return String
     */
    @Override
    public String validate(Occupy occupy,String type){


        return "";
    }


    /**
     * Description:库存占用分页返回
     * @param request //检索条件
     * @param page //分页参数
     * @return IPage<Occupy>   //分页记录
     */
    @Override
    public IPage<Occupy> selectList(OccupyRequest request, Page<Occupy> page){
        LambdaQueryWrapper<Occupy> lambdaQueryWrapper = new LambdaQueryWrapper<>();

        if (null != request.getId()) {
            lambdaQueryWrapper.eq(Occupy::getId, request.getId());
        }


        lambdaQueryWrapper.orderByDesc(Occupy::getId);
        Page<Occupy> selectPage = this.baseMapper.selectPage(page, lambdaQueryWrapper);
        return selectPage;
    }



}